import 'package:car_map/widget/load_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_swiper/flutter_swiper.dart';

///咖啡轮播图
class WidgetCoffeeSwiper extends StatelessWidget{

  final String pathUrl;

  const WidgetCoffeeSwiper({Key key, this.pathUrl}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Container(
      height: ScreenUtil().setHeight(350.0),
      child: Swiper(
        itemCount: 3,
        pagination: new SwiperPagination(),
        autoplay: false,
        itemBuilder: (context, index) {
          return itemSwiper();
        },
      ),
    );
  }

  Widget itemSwiper(){
    return Container(
      child: ClipRRect(
        borderRadius: BorderRadius.all(Radius.circular(5.0)),
        child: LoadImage(pathUrl,fit: BoxFit.cover,),
      ),
    );
  }

}